namespace Agro.Models {
        using System;
        using SN.Data;
        
        
        /// <summary>
        /// 表名：T_Role 主键列：Role_ID
        /// </summary>
        [SerializableAttribute()]
        public partial class T_Role : Entity {
            
            protected Int32 _Role_ID;
            
            protected String _Role_Code;
            
            protected String _Role_Name;
            
            protected String _Role_Description;
            
            protected String _Role_IsAvailable;
            
            protected String _Role_IsInnerRole;
            
            protected String _Role_CreateUserID;
            
            protected String _Role_CreateDate;
            
            protected String _Role_CreateIP;
            
            /// <summary>
            /// ID
            /// </summary>
            public Int32 Role_ID {
                get {
                    return this._Role_ID;
                }
                set {
                    this.OnPropertyValueChange(_.Role_ID, _Role_ID, value);
                    this._Role_ID = value;
                }
            }
            
            /// <summary>
            /// 角色代码
            /// </summary>
            public String Role_Code {
                get {
                    return this._Role_Code;
                }
                set {
                    this.OnPropertyValueChange(_.Role_Code, _Role_Code, value);
                    this._Role_Code = value;
                }
            }
            
            /// <summary>
            /// 角色名称
            /// </summary>
            public String Role_Name {
                get {
                    return this._Role_Name;
                }
                set {
                    this.OnPropertyValueChange(_.Role_Name, _Role_Name, value);
                    this._Role_Name = value;
                }
            }
            
            /// <summary>
            /// 角色描述
            /// </summary>
            public String Role_Description {
                get {
                    return this._Role_Description;
                }
                set {
                    this.OnPropertyValueChange(_.Role_Description, _Role_Description, value);
                    this._Role_Description = value;
                }
            }
            
            /// <summary>
            /// 是否有效
            /// </summary>
            public String Role_IsAvailable {
                get {
                    return this._Role_IsAvailable;
                }
                set {
                    this.OnPropertyValueChange(_.Role_IsAvailable, _Role_IsAvailable, value);
                    this._Role_IsAvailable = value;
                }
            }
            
            /// <summary>
            /// 是否内置角色
            /// </summary>
            public String Role_IsInnerRole {
                get {
                    return this._Role_IsInnerRole;
                }
                set {
                    this.OnPropertyValueChange(_.Role_IsInnerRole, _Role_IsInnerRole, value);
                    this._Role_IsInnerRole = value;
                }
            }
            
            /// <summary>
            /// 创建人员
            /// </summary>
            public String Role_CreateUserID {
                get {
                    return this._Role_CreateUserID;
                }
                set {
                    this.OnPropertyValueChange(_.Role_CreateUserID, _Role_CreateUserID, value);
                    this._Role_CreateUserID = value;
                }
            }
            
            /// <summary>
            /// 创建时间
            /// </summary>
            public String Role_CreateDate {
                get {
                    return this._Role_CreateDate;
                }
                set {
                    this.OnPropertyValueChange(_.Role_CreateDate, _Role_CreateDate, value);
                    this._Role_CreateDate = value;
                }
            }
            
            /// <summary>
            /// 创建IP
            /// </summary>
            public String Role_CreateIP {
                get {
                    return this._Role_CreateIP;
                }
                set {
                    this.OnPropertyValueChange(_.Role_CreateIP, _Role_CreateIP, value);
                    this._Role_CreateIP = value;
                }
            }
            
            /// <summary>
            /// 获取实体对应的表名
            /// </summary>
            protected override Table GetTable() {
                return new Table<T_Role>("T_Role");
            }
            
            /// <summary>
            /// 获取实体中的标识列
            /// </summary>
            protected override Field GetIdentityField() {
                return _.Role_ID;
            }
            
            /// <summary>
            /// 获取实体中的主键列
            /// </summary>
            protected override Field[] GetPrimaryKeyFields() {
                return new Field[] {
                        _.Role_ID};
            }
            
            /// <summary>
            /// 获取列信息
            /// </summary>
            protected override Field[] GetFields() {
                return new Field[] {
                        _.Role_ID,
                        _.Role_Code,
                        _.Role_Name,
                        _.Role_Description,
                        _.Role_IsAvailable,
                        _.Role_IsInnerRole,
                        _.Role_CreateUserID,
                        _.Role_CreateDate,
                        _.Role_CreateIP};
            }
            
            /// <summary>
            /// 获取列数据
            /// </summary>
            protected override object[] GetValues() {
                return new object[] {
                        this._Role_ID,
                        this._Role_Code,
                        this._Role_Name,
                        this._Role_Description,
                        this._Role_IsAvailable,
                        this._Role_IsInnerRole,
                        this._Role_CreateUserID,
                        this._Role_CreateDate,
                        this._Role_CreateIP};
            }
            
            /// <summary>
            /// 给当前实体赋值
            /// </summary>
            protected override void SetValues(IRowReader reader) {
                if ((false == reader.IsDBNull(_.Role_ID))) {
                    this._Role_ID = reader.GetInt32(_.Role_ID);
                }
                if ((false == reader.IsDBNull(_.Role_Code))) {
                    this._Role_Code = reader.GetString(_.Role_Code);
                }
                if ((false == reader.IsDBNull(_.Role_Name))) {
                    this._Role_Name = reader.GetString(_.Role_Name);
                }
                if ((false == reader.IsDBNull(_.Role_Description))) {
                    this._Role_Description = reader.GetString(_.Role_Description);
                }
                if ((false == reader.IsDBNull(_.Role_IsAvailable))) {
                    this._Role_IsAvailable = reader.GetString(_.Role_IsAvailable);
                }
                if ((false == reader.IsDBNull(_.Role_IsInnerRole))) {
                    this._Role_IsInnerRole = reader.GetString(_.Role_IsInnerRole);
                }
                if ((false == reader.IsDBNull(_.Role_CreateUserID))) {
                    this._Role_CreateUserID = reader.GetString(_.Role_CreateUserID);
                }
                if ((false == reader.IsDBNull(_.Role_CreateDate))) {
                    this._Role_CreateDate = reader.GetString(_.Role_CreateDate);
                }
                if ((false == reader.IsDBNull(_.Role_CreateIP))) {
                    this._Role_CreateIP = reader.GetString(_.Role_CreateIP);
                }
            }
            
            public override int GetHashCode() {
                return base.GetHashCode();
            }
            
            public override bool Equals(object obj) {
                if ((obj == null)) {
                    return false;
                }
                if ((false == typeof(T_Role).IsAssignableFrom(obj.GetType()))) {
                    return false;
                }
                if ((((object)(this)) == ((object)(obj)))) {
                    return true;
                }
                return false;
            }
            
            public class _ {
                
                /// <summary>
                /// 表示选择所有列，与*等同
                /// </summary>
                public static AllField All = new AllField<T_Role>();
                
                /// <summary>
                /// ID - 字段名：Role_ID - 数据类型：Int32
                /// </summary>
                public static Field Role_ID = new Field<T_Role>("Role_ID");
                
                /// <summary>
                /// 角色代码 - 字段名：Role_Code - 数据类型：String
                /// </summary>
                public static Field Role_Code = new Field<T_Role>("Role_Code");
                
                /// <summary>
                /// 角色名称 - 字段名：Role_Name - 数据类型：String
                /// </summary>
                public static Field Role_Name = new Field<T_Role>("Role_Name");
                
                /// <summary>
                /// 角色描述 - 字段名：Role_Description - 数据类型：String
                /// </summary>
                public static Field Role_Description = new Field<T_Role>("Role_Description");
                
                /// <summary>
                /// 是否有效 - 字段名：Role_IsAvailable - 数据类型：String
                /// </summary>
                public static Field Role_IsAvailable = new Field<T_Role>("Role_IsAvailable");
                
                /// <summary>
                /// 是否内置角色 - 字段名：Role_IsInnerRole - 数据类型：String
                /// </summary>
                public static Field Role_IsInnerRole = new Field<T_Role>("Role_IsInnerRole");
                
                /// <summary>
                /// 创建人员 - 字段名：Role_CreateUserID - 数据类型：String
                /// </summary>
                public static Field Role_CreateUserID = new Field<T_Role>("Role_CreateUserID");
                
                /// <summary>
                /// 创建时间 - 字段名：Role_CreateDate - 数据类型：String
                /// </summary>
                public static Field Role_CreateDate = new Field<T_Role>("Role_CreateDate");
                
                /// <summary>
                /// 创建IP - 字段名：Role_CreateIP - 数据类型：String
                /// </summary>
                public static Field Role_CreateIP = new Field<T_Role>("Role_CreateIP");
            }
        }
    }
    